package jman.teemwork14;

import java.sql.SQLException;

import javax.servlet.http.HttpSession;

public class UserService {
	static HttpSession session;
	public boolean login(String userName,String id) throws SQLException{
		boolean flag=false;
		UserDao ud=new UserDao();
		if(userName!=""){
			User user=ud.getUserByUserName(userName);
			if(id.equals(user.getId())){
				flag=true;
			}
		}
		return flag;
	}
	public boolean vote(String id,String ID) throws SQLException{
		boolean flag=false;
		UserDao ud=new UserDao();
		if(ud.isVote(id)){
			flag=ud.vote(id, ID);
		}
		return flag;
	}
}
